package com.wanmait.demo.pojo;

import java.io.Serializable;

public class Community implements Serializable {
    private Integer id;

    /**
	* 小区名
	*/
    private String communityName;

    /**
	* 街道id
	*/
    private Town townId;

    /**
	* 状态
	*/
    private Boolean enable;
    private String detailedAddress;

    private static final long serialVersionUID = 1L;
    //编写人：闫应鹏
    //功能：将负责地区拼接
    public String getDetailedAddress()
    {
        String districtName=townId.getDistrict().getDistrictName();
        String townName=townId.getTownName();
        String adressName=districtName+townName+communityName;
        detailedAddress=adressName;
        return adressName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    public Town getTownId() {
        return townId;
    }

    public void setTownId(Town townId) {
        this.townId = townId;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", communityName=").append(communityName);
        sb.append(", townId=").append(townId);
        sb.append(", enable=").append(enable);
        sb.append("]");
        return sb.toString();
    }
}